package org.posupe.areas;

import java.util.ArrayList;
import java.util.Iterator;

public class IteratorAreasArrayList implements IteratorAreas {
	private ArrayList areas;
	private int indiceAtual = 0;
	
	public IteratorAreasArrayList () {
		this.areas = new ArrayList();
	}
	
	public boolean hasNext() {
		return this.indiceAtual < this.areas.size();
	}
	public Area next() {
		Area area = (Area) this.areas.get(indiceAtual);
		this.indiceAtual++;
		return area;
	}
	
	public void add(Area area) {		
		this.areas.add(area);
	}
	
	public Iterator iterator() {
		return areas.iterator();
	}
	
}
